inherited frmCMCheckAcceptBill: TfrmCMCheckAcceptBill
  Left = 405
  Top = 174
  Caption = #22996#22806#39564#25910#21333
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlDBCtrl: TPanel
    inherited pnlThirdtrade: TPanel
      inherited edtTTtraderid: TcxDBLookupComboBox
        ExplicitHeight = 20
      end
      inherited lblTTtraderid: TcxLabel
        AnchorX = 78
      end
      inherited cxLabel1: TcxLabel
        Left = 216
        ExplicitLeft = 216
        AnchorX = 244
      end
      inherited edtTTamount: TcxDBCalcEdit
        ExplicitHeight = 20
      end
      inherited edtTTremark: TcxDBTextEdit
        ExplicitHeight = 20
      end
      inherited edtTTBalanceid: TcxDBLookupComboBox
        ExplicitHeight = 20
      end
      inherited edtTTAccountid: TcxDBLookupComboBox
        ExplicitHeight = 20
      end
      inherited lblTTBalanceid: TcxLabel
        Left = 381
        ExplicitLeft = 381
        AnchorX = 433
      end
      inherited edtTTBalanceamt: TcxDBCalcEdit
        ExplicitHeight = 20
      end
    end
    inherited lblName: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited edtDate: TcxDBDateEdit
      ExplicitHeight = 20
    end
    inherited edtCode: TcxDBTextEdit
      ExplicitHeight = 20
    end
    inherited DtlPageCtrl: TcxPageControl
      inherited tabMain: TcxTabSheet
        ExplicitWidth = 872
        inherited DtlGrid: TcxGrid
          inherited DtlGridDBTableView: TcxGridDBBandedTableView
            inherited colbno: TcxGridDBBandedColumn
              Position.ColIndex = 7
            end
            inherited colProductid: TcxGridDBBandedColumn
              Position.ColIndex = 2
            end
            inherited colUnitname: TcxGridDBBandedColumn
              Position.ColIndex = 3
            end
            inherited colQuantity: TcxGridDBBandedColumn
              Position.ColIndex = 4
            end
            inherited colbQuantity: TcxGridDBBandedColumn
              Position.ColIndex = 6
            end
          end
        end
        inherited sptDtl: TcxSplitter
          Width = 872
          ExplicitWidth = 872
        end
      end
      inherited tsSum: TcxTabSheet
        ExplicitWidth = 872
      end
    end
    inherited edtCreate_time: TcxDBTimeEdit
      ExplicitHeight = 20
    end
    inherited lblPrinted: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited dynlblCreate_by: TcxLabel
      AnchorX = 221
    end
    inherited dynedtCreate_by: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblCheck_by: TcxLabel
      AnchorX = 429
    end
    inherited dynedtCheck_by: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblFilid: TcxLabel
      AnchorX = 88
    end
    inherited dynedtFilid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblDeptid: TcxLabel
      AnchorX = 301
    end
    inherited dynedtDeptid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblEmpid: TcxLabel
      AnchorX = 505
    end
    inherited dynedtEmpid: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
    inherited dynlblBKind: TcxLabel
      AnchorX = 149
    end
    inherited dynedtBKind: TcxDBLookupComboBox
      ExplicitHeight = 20
    end
  end
  inherited Panel1: TPanel
    inherited labFuncName: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited labFuncDesc: TcxLabel
      Style.IsFontAssigned = True
    end
  end
  inherited pnlTop: TPanel
    inherited edtPrint: TcxLookupComboBox
      ExplicitHeight = 20
    end
  end
  inherited pnlBottom: TPanel
    inherited lblDepotQty: TcxLabel
      Style.IsFontAssigned = True
    end
    inherited barBill: TcxProgressBar
      ExplicitHeight = 20
    end
  end
  inherited MainDataSource: TDataSource
    Top = 181
  end
  inherited pmExec: TPopupMenu
    Top = 69
  end
  inherited cxStyleRepository1: TcxStyleRepository
    PixelsPerInch = 96
    inherited cxGridBandedTableViewStyleSheet1: TcxGridBandedTableViewStyleSheet
      BuiltIn = True
    end
  end
  inherited cdsMaster: TClientDataSet
    object cdsMasterbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsMasterbkind: TIntegerField
      FieldName = 'bkind'
    end
    object cdsMasterbstate: TIntegerField
      FieldName = 'bstate'
    end
    object cdsMasterbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object cdsMasterbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object cdsMastercommtypeid: TIntegerField
      FieldName = 'commtypeid'
    end
    object cdsMastertraderid: TIntegerField
      FieldName = 'traderid'
    end
    object cdsMastercreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object cdsMasterempid: TIntegerField
      FieldName = 'empid'
    end
    object cdsMastercheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object cdsMasterdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object cdsMasterfilid: TIntegerField
      FieldName = 'filid'
    end
    object cdsMastervoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object cdsMasteramount: TFloatField
      FieldName = 'amount'
    end
    object cdsMasterexpense: TFloatField
      FieldName = 'expense'
    end
    object cdsMastermaterial: TFloatField
      FieldName = 'material'
    end
    object cdsMasterrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsMastercreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object cdsMastercheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object cdsMasterupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object cdsMasterremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object cdsMastermachiningamt: TFloatField
      FieldName = 'machiningamt'
    end
    object cdsMastercustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsMastercustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsMastercustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsMastercustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsMastercustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsMastercustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsMastercustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsMastercustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsMastercustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsMastercustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsMastercustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsMastercustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsMastercustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsMastercustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsMastercustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsMasterrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object cdsMasterworkshopid: TIntegerField
      FieldName = 'workshopid'
    end
    object cdsMastert_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object cdsMasterworkshopname: TStringField
      FieldName = 'workshopname'
      Size = 60
    end
    object cdsMasterct_name: TStringField
      FieldName = 'ct_name'
      Size = 60
    end
    object cdsMastervouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
  end
  inherited dspDetail: TDataSetProvider
    Top = 289
  end
  inherited cdsDetail: TClientDataSet
    BeforeDelete = cdsDetailBeforeDelete
    object cdsDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object cdsDetailbdtlno: TIntegerField
      FieldName = 'bdtlno'
    end
    object cdsDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object cdsDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object cdsDetailprice: TFloatField
      FieldName = 'price'
    end
    object cdsDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsDetailamount: TFloatField
      FieldName = 'amount'
    end
    object cdsDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object cdsDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object cdsDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object cdsDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object cdsDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object cdsDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object cdsDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object cdsDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object cdsDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object cdsDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object cdsDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object cdsDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object cdsDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object cdsDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object cdsDetailrelationbdtlno: TIntegerField
      FieldName = 'relationbdtlno'
    end
    object cdsDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object cdsDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object cdsDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object cdsDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object cdsDetailrelationorderno: TStringField
      FieldName = 'relationorderno'
      Size = 40
    end
    object cdsDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 40
    end
    object cdsDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object cdsDetaillength: TFloatField
      FieldName = 'length'
    end
    object cdsDetailwidth: TFloatField
      FieldName = 'width'
    end
    object cdsDetailheight: TFloatField
      FieldName = 'height'
    end
    object cdsDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object cdsDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object cdsDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object cdsDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object cdsDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object cdsDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object cdsDetailtypename: TStringField
      FieldName = 'typename'
      Size = 6
    end
    object cdsDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object cdsDetaildrawqty: TFloatField
      FieldName = 'drawqty'
    end
    object cdsDetailwastedqty: TFloatField
      FieldName = 'wastedqty'
    end
    object cdsDetailoldqty: TFloatField
      FieldName = 'oldqty'
    end
    object cdsDetailmonetqty: TFloatField
      FieldName = 'monetqty'
    end
    object cdsDetailinputbatch: TStringField
      FieldName = 'inputbatch'
      Size = 9
    end
    object cdsDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object cdsDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object cdsDetailfdrawqty: TFloatField
      FieldName = 'fdrawqty'
    end
    object cdsDetailnouseqty: TFloatField
      FieldName = 'nouseqty'
    end
    object cdsDetailfdrawamt: TFloatField
      FieldName = 'fdrawamt'
    end
    object cdsDetailnouseamt: TFloatField
      FieldName = 'nouseamt'
    end
    object cdsDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object cdsDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
  end
  inherited qryDetail: TUniQuery
    SQL.Strings = (
      
        'select m.*,'#39#21407#26448#26009#39' as typename,u.unitname, b.drawqty,m.quantity as' +
        ' wastedqty,'
      
        '     m.quantity as oldqty ,cast(b.drawqty-b.wastedqty as decimal' +
        '(18,4)) as monetqty,'#39'batchcode'#39' as inputbatch,'
      '     l.unitname as unitassname,p.code as p_code,'
      
        '     p.name as p_name,p.spec as p_spec,u.barcode,b.drawqty as fd' +
        'rawqty,'
      
        '     cast(b.drawqty- b.wastedqty+m.quantity as decimal(18,4)) as' +
        ' nouseqty,'
      
        '     cast(b.drawqty*m.price as decimal(18,4)) as fdrawamt,cast((' +
        'b.drawqty- b.wastedqty+m.quantity)*m.price as decimal(18,2)) as ' +
        'nouseamt'
      '     from tb_comcheckacceptraw m'
      
        '     left join tb_commissionraw b on (m.relationbid=b.bid and m.' +
        'relationbno=b.bno and m.relationbdtlno=b.bdtlno and m.productid=' +
        'b.productid)'
      
        '     left join td_unitprice u on m.productid=u.productid and m.u' +
        'nitid=u.unitid'
      
        '     left join td_unitprice l on (l.u_no=0 and m.productid=l.pro' +
        'ductid)'
      '     left join td_product p on m.productid=p.p_id'
      '     where m.bid=0'
      
        '     and m.productid not in(select subproductid from tb_commissi' +
        'onrawsub '
      
        '       where bid=m.relationbid and bno=m.relationbno and m.relat' +
        'ionbdtlno=bdtlno)'
      '     union all'
      
        '     select m.*,'#39#26367#20195#21697#39' as typename,u.unitname, b.drawqty,m.quanti' +
        'ty as wastedqty,'
      
        '    m.quantity as oldqty ,cast(b.drawqty-b.wastedqty as decimal(' +
        '18,4)) as monetqty ,'#39'batchcode'#39' as inputbatch,'
      
        '     l.unitname as unitassname,p.code as p_code,p.name as p_name' +
        ','
      '     p.spec as p_spec,u.barcode,b.drawqty as fdrawqty,'
      
        '     cast(b.drawqty-b.wastedqty+m.quantity as decimal(18,4)) as ' +
        'nouseqty,'
      
        '     cast(b.drawqty*m.price as decimal(18,4)) as fdrawamt,cast((' +
        'b.drawqty- b.wastedqty+m.quantity)*m.price as decimal(18,2)) as ' +
        'nouseamt'
      '     from tb_comcheckacceptraw m'
      
        '     left join tb_commissionrawsub b on (m.relationbid=b.bid and' +
        ' m.relationbno=b.bno and m.relationbdtlno=b.bdtlno and m.product' +
        'id=b.subproductid)'
      
        '     left join td_unitprice u on m.productid=u.productid and m.u' +
        'nitid=u.unitid'
      
        '     left join td_unitprice l on (l.u_no=0 and m.productid=l.pro' +
        'ductid)'
      '     left join td_product p on m.productid=p.p_id'
      '     where m.bid=0'
      
        '     and m.productid in (select subproductid from tb_commissionr' +
        'awsub'
      
        '       where bid=m.relationbid and bno=m.relationbno and m.relat' +
        'ionbdtlno=bdtlno)')
    object qryDetailbid: TIntegerField
      FieldName = 'bid'
    end
    object qryDetailbno: TIntegerField
      FieldName = 'bno'
    end
    object qryDetailbdtlno: TIntegerField
      FieldName = 'bdtlno'
    end
    object qryDetailproductid: TIntegerField
      FieldName = 'productid'
    end
    object qryDetailcprice: TFloatField
      FieldName = 'cprice'
    end
    object qryDetailprice: TFloatField
      FieldName = 'price'
    end
    object qryDetailquantity: TFloatField
      FieldName = 'quantity'
    end
    object qryDetailamount: TFloatField
      FieldName = 'amount'
    end
    object qryDetailunitid: TIntegerField
      FieldName = 'unitid'
    end
    object qryDetailbquantity: TFloatField
      FieldName = 'bquantity'
    end
    object qryDetailbprice: TFloatField
      FieldName = 'bprice'
    end
    object qryDetailunit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object qryDetailunit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object qryDetailunit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object qryDetailassqty: TFloatField
      FieldName = 'assqty'
    end
    object qryDetailrelationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object qryDetailbatchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object qryDetailproductdate: TDateTimeField
      FieldName = 'productdate'
    end
    object qryDetailvaliddate: TDateTimeField
      FieldName = 'validdate'
    end
    object qryDetailrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object qryDetailrelationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object qryDetailrelationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object qryDetailrelationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object qryDetailrelationbdtlno: TIntegerField
      FieldName = 'relationbdtlno'
    end
    object qryDetailrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object qryDetailrelationqty: TFloatField
      FieldName = 'relationqty'
    end
    object qryDetailioqty: TFloatField
      FieldName = 'ioqty'
    end
    object qryDetailexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object qryDetailrelationorderno: TStringField
      FieldName = 'relationorderno'
      Size = 40
    end
    object qryDetailcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object qryDetailcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object qryDetailcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object qryDetailcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object qryDetailcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object qryDetailcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object qryDetailcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object qryDetailcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object qryDetailcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object qryDetailcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object qryDetailcustom11: TFloatField
      FieldName = 'custom11'
    end
    object qryDetailcustom12: TFloatField
      FieldName = 'custom12'
    end
    object qryDetailcustom13: TFloatField
      FieldName = 'custom13'
    end
    object qryDetailcustom14: TFloatField
      FieldName = 'custom14'
    end
    object qryDetailcustom15: TFloatField
      FieldName = 'custom15'
    end
    object qryDetailsaleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 40
    end
    object qryDetailrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object qryDetaillength: TFloatField
      FieldName = 'length'
    end
    object qryDetailwidth: TFloatField
      FieldName = 'width'
    end
    object qryDetailheight: TFloatField
      FieldName = 'height'
    end
    object qryDetailspecificweight: TFloatField
      FieldName = 'specificweight'
    end
    object qryDetailcustom16: TFloatField
      FieldName = 'custom16'
    end
    object qryDetailcustom17: TFloatField
      FieldName = 'custom17'
    end
    object qryDetailcustom18: TFloatField
      FieldName = 'custom18'
    end
    object qryDetailcustom19: TFloatField
      FieldName = 'custom19'
    end
    object qryDetailcustom20: TFloatField
      FieldName = 'custom20'
    end
    object qryDetailtypename: TStringField
      FieldName = 'typename'
      Size = 6
    end
    object qryDetailunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object qryDetaildrawqty: TFloatField
      FieldName = 'drawqty'
    end
    object qryDetailwastedqty: TFloatField
      FieldName = 'wastedqty'
    end
    object qryDetailoldqty: TFloatField
      FieldName = 'oldqty'
    end
    object qryDetailmonetqty: TFloatField
      FieldName = 'monetqty'
    end
    object qryDetailinputbatch: TStringField
      FieldName = 'inputbatch'
      Size = 9
    end
    object qryDetailunitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object qryDetailp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object qryDetailp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object qryDetailp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object qryDetailbarcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object qryDetailfdrawqty: TFloatField
      FieldName = 'fdrawqty'
    end
    object qryDetailnouseqty: TFloatField
      FieldName = 'nouseqty'
    end
    object qryDetailfdrawamt: TFloatField
      FieldName = 'fdrawamt'
    end
    object qryDetailnouseamt: TFloatField
      FieldName = 'nouseamt'
    end
    object qryDetailp_calc: TByteField
      FieldName = 'p_calc'
    end
    object qryDetailunitrate: TFloatField
      FieldName = 'unitrate'
    end
  end
  inherited MainDataSet: TUniQuery
    SQL.Strings = (
      'select top 1 m.*, t.name as t_name,w.name as workshopname'
      
        '     ,cm.name ct_name,ct.name + '#39' '#39' + cast(aa.voucherno as varch' +
        'ar(10)) as vouchercode '
      '     from TB_COMCHECKACCEPT m'
      '     left join td_trader t on (t.traderid=m.traderid)'
      '     left join tfb_voucher aa on (aa.voucherid=m.voucherid)'
      '     left join tfd_vouword ct on (ct.id=aa.vouwordid)'
      '     left join td_commistype cm on (m.commtypeid=cm.id)'
      '     left join td_workshop w on m.workshopid=w.workshopid'
      '     where 1=1')
    object MainDataSetbid: TIntegerField
      FieldName = 'bid'
    end
    object MainDataSetbkind: TIntegerField
      FieldName = 'bkind'
    end
    object MainDataSetbstate: TIntegerField
      FieldName = 'bstate'
    end
    object MainDataSetbcode: TStringField
      FieldName = 'bcode'
      Size = 40
    end
    object MainDataSetbdate: TDateTimeField
      FieldName = 'bdate'
    end
    object MainDataSetcommtypeid: TIntegerField
      FieldName = 'commtypeid'
    end
    object MainDataSettraderid: TIntegerField
      FieldName = 'traderid'
    end
    object MainDataSetcreate_by: TIntegerField
      FieldName = 'create_by'
    end
    object MainDataSetempid: TIntegerField
      FieldName = 'empid'
    end
    object MainDataSetcheck_by: TIntegerField
      FieldName = 'check_by'
    end
    object MainDataSetdeptid: TIntegerField
      FieldName = 'deptid'
    end
    object MainDataSetfilid: TIntegerField
      FieldName = 'filid'
    end
    object MainDataSetvoucherid: TIntegerField
      FieldName = 'voucherid'
    end
    object MainDataSetamount: TFloatField
      FieldName = 'amount'
    end
    object MainDataSetexpense: TFloatField
      FieldName = 'expense'
    end
    object MainDataSetmaterial: TFloatField
      FieldName = 'material'
    end
    object MainDataSetrelationcount: TByteField
      FieldName = 'relationcount'
    end
    object MainDataSetcreate_time: TDateTimeField
      FieldName = 'create_time'
    end
    object MainDataSetcheck_time: TDateTimeField
      FieldName = 'check_time'
    end
    object MainDataSetupdate_time: TDateTimeField
      FieldName = 'update_time'
    end
    object MainDataSetremark: TStringField
      FieldName = 'remark'
      Size = 200
    end
    object MainDataSetmachiningamt: TFloatField
      FieldName = 'machiningamt'
    end
    object MainDataSetcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object MainDataSetcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object MainDataSetcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object MainDataSetcustom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object MainDataSetcustom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object MainDataSetcustom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object MainDataSetcustom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object MainDataSetcustom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object MainDataSetcustom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object MainDataSetcustom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object MainDataSetcustom11: TFloatField
      FieldName = 'custom11'
    end
    object MainDataSetcustom12: TFloatField
      FieldName = 'custom12'
    end
    object MainDataSetcustom13: TFloatField
      FieldName = 'custom13'
    end
    object MainDataSetcustom14: TFloatField
      FieldName = 'custom14'
    end
    object MainDataSetcustom15: TFloatField
      FieldName = 'custom15'
    end
    object MainDataSetrelationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object MainDataSetworkshopid: TIntegerField
      FieldName = 'workshopid'
    end
    object MainDataSett_name: TWideStringField
      FieldName = 't_name'
      Size = 80
    end
    object MainDataSetworkshopname: TStringField
      FieldName = 'workshopname'
      Size = 60
    end
    object MainDataSetct_name: TStringField
      FieldName = 'ct_name'
      Size = 60
    end
    object MainDataSetvouchercode: TStringField
      FieldName = 'vouchercode'
      Size = 71
    end
  end
  inherited qryImei: TUniQuery
    Left = 600
    Top = 417
  end
  inherited cdsDetail2: TClientDataSet
    object cdsDetail2bid: TIntegerField
      FieldName = 'bid'
    end
    object cdsDetail2bno: TIntegerField
      FieldName = 'bno'
    end
    object cdsDetail2borderno: TIntegerField
      FieldName = 'borderno'
    end
    object cdsDetail2depotid: TIntegerField
      FieldName = 'depotid'
    end
    object cdsDetail2productid: TIntegerField
      FieldName = 'productid'
    end
    object cdsDetail2quantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsDetail2amount: TFloatField
      FieldName = 'amount'
    end
    object cdsDetail2unitid: TIntegerField
      FieldName = 'unitid'
    end
    object cdsDetail2bquantity: TFloatField
      FieldName = 'bquantity'
    end
    object cdsDetail2bprice: TFloatField
      FieldName = 'bprice'
    end
    object cdsDetail2unit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object cdsDetail2unit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object cdsDetail2unit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object cdsDetail2assqty: TFloatField
      FieldName = 'assqty'
    end
    object cdsDetail2relationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object cdsDetail2expense: TFloatField
      FieldName = 'expense'
    end
    object cdsDetail2material: TFloatField
      FieldName = 'material'
    end
    object cdsDetail2batchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object cdsDetail2productdate: TDateTimeField
      FieldName = 'productdate'
    end
    object cdsDetail2validdate: TDateTimeField
      FieldName = 'validdate'
    end
    object cdsDetail2relationqty: TFloatField
      FieldName = 'relationqty'
    end
    object cdsDetail2relationcount: TByteField
      FieldName = 'relationcount'
    end
    object cdsDetail2relationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object cdsDetail2relationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object cdsDetail2relationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object cdsDetail2relationcheckupbid: TIntegerField
      FieldName = 'relationcheckupbid'
    end
    object cdsDetail2relationcheckupbno: TIntegerField
      FieldName = 'relationcheckupbno'
    end
    object cdsDetail2ioqty: TFloatField
      FieldName = 'ioqty'
    end
    object cdsDetail2explan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object cdsDetail2price: TFloatField
      FieldName = 'price'
    end
    object cdsDetail2machiningamt: TFloatField
      FieldName = 'machiningamt'
    end
    object cdsDetail2custom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object cdsDetail2custom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object cdsDetail2custom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object cdsDetail2custom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object cdsDetail2custom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object cdsDetail2custom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object cdsDetail2custom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object cdsDetail2custom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object cdsDetail2custom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object cdsDetail2custom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object cdsDetail2custom11: TFloatField
      FieldName = 'custom11'
    end
    object cdsDetail2custom12: TFloatField
      FieldName = 'custom12'
    end
    object cdsDetail2custom13: TFloatField
      FieldName = 'custom13'
    end
    object cdsDetail2custom14: TFloatField
      FieldName = 'custom14'
    end
    object cdsDetail2custom15: TFloatField
      FieldName = 'custom15'
    end
    object cdsDetail2saleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 40
    end
    object cdsDetail2relationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object cdsDetail2length: TFloatField
      FieldName = 'length'
    end
    object cdsDetail2width: TFloatField
      FieldName = 'width'
    end
    object cdsDetail2height: TFloatField
      FieldName = 'height'
    end
    object cdsDetail2specificweight: TFloatField
      FieldName = 'specificweight'
    end
    object cdsDetail2custom16: TFloatField
      FieldName = 'custom16'
    end
    object cdsDetail2custom17: TFloatField
      FieldName = 'custom17'
    end
    object cdsDetail2custom18: TFloatField
      FieldName = 'custom18'
    end
    object cdsDetail2custom19: TFloatField
      FieldName = 'custom19'
    end
    object cdsDetail2custom20: TFloatField
      FieldName = 'custom20'
    end
    object cdsDetail2qtitemid: TIntegerField
      FieldName = 'qtitemid'
    end
    object cdsDetail2qtresultid: TIntegerField
      FieldName = 'qtresultid'
    end
    object cdsDetail2qtdealresultid: TIntegerField
      FieldName = 'qtdealresultid'
    end
    object cdsDetail2qtproblevid: TIntegerField
      FieldName = 'qtproblevid'
    end
    object cdsDetail2qtworkerid: TIntegerField
      FieldName = 'qtworkerid'
    end
    object cdsDetail2qtpickqty: TFloatField
      FieldName = 'qtpickqty'
    end
    object cdsDetail2qtpickokqty: TFloatField
      FieldName = 'qtpickokqty'
    end
    object cdsDetail2qtpickwasterqty: TFloatField
      FieldName = 'qtpickwasterqty'
    end
    object cdsDetail2applyqty: TFloatField
      FieldName = 'applyqty'
    end
    object cdsDetail2wasterqty: TFloatField
      FieldName = 'wasterqty'
    end
    object cdsDetail2Allqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object cdsDetail2wasterrate: TFloatField
      FieldName = 'wasterrate'
    end
    object cdsDetail2machiningbdate: TDateTimeField
      FieldName = 'machiningbdate'
    end
    object cdsDetail2relationbcode_1: TStringField
      FieldName = 'relationbcode_1'
      Size = 40
    end
    object cdsDetail2makeqty: TFloatField
      FieldName = 'makeqty'
    end
    object cdsDetail2uncompletedqty: TFloatField
      FieldName = 'uncompletedqty'
    end
    object cdsDetail2p_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object cdsDetail2p_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsDetail2p_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsDetail2p_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsDetail2p_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object cdsDetail2p_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object cdsDetail2p_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object cdsDetail2p_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object cdsDetail2p_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object cdsDetail2p_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object cdsDetail2p_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object cdsDetail2p_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object cdsDetail2p_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object cdsDetail2p_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object cdsDetail2p_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object cdsDetail2producttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object cdsDetail2producttrademarkid: TIntegerField
      FieldName = 'producttrademarkid'
    end
    object cdsDetail2depotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object cdsDetail2depotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object cdsDetail2barcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object cdsDetail2unitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object cdsDetail2unitrate: TFloatField
      FieldName = 'unitrate'
    end
    object cdsDetail2baseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object cdsDetail2unitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object cdsDetail2productpic: TBlobField
      FieldName = 'productpic'
    end
    object cdsDetail2relationwasterqty: TFloatField
      FieldName = 'relationwasterqty'
    end
    object cdsDetail2uncompqty: TFloatField
      FieldName = 'uncompqty'
    end
  end
  inherited pmDetail2: TPopupMenu
    object muDtlSameDepotPark: TMenuItem [2]
      Caption = '-'
    end
    object muDtl2SameDepot: TMenuItem [3]
      Caption = #39564#25910#20837#24211#21516#19968#20179#24211
      OnClick = muDtl2SameDepotClick
    end
  end
  inherited qryDetail2: TUniQuery
    SQL.Strings = (
      
        'select d.*,cast(dbo.f_getallqty(d.productid,d.unit1qty,d.unit2qt' +
        'y,d.unit3qty) as varchar(30)) as Allqty'
      '     ,d.wasterqty/d.applyqty*100 as wasterrate'
      
        '     ,rm.bdate as machiningbdate, rm.bcode as relationbcode, r.q' +
        'uantity as makeqty'
      '     ,r.quantity-r.completedqty+d.applyqty as uncompletedqty'
      
        '     ,p.kind p_kind,p.code p_code, p.name p_name, p.spec p_spec,' +
        ' p.abname p_abname'
      
        '     ,p.custom1 p_custom1, p.custom2 p_custom2, p.custom3 p_cust' +
        'om3, p.custom4 p_custom4, p.custom5 p_custom5 '
      
        '     ,p.custom6 p_custom6, p.custom7 p_custom7, p.custom8 p_cust' +
        'om8, p.custom9 p_custom9, p.custom10 p_custom10 '
      '     ,p.producttypeid, p.producttrademarkid'
      '     ,dt.code depotcode, dt.name depotname '
      
        '     ,u.barcode, u.unitname, u.rate unitrate, t.unitname as base' +
        'unitname,l.unitname as unitassname '
      '     ,cast(null as image) as productpic'
      '     from TB_COMCHECKACCEPTDTL d'
      '     left join td_product p on d.productid=p.p_id'
      '     left join td_depot dt on d.depotid=dt.depotid'
      '     left join td_unitprice u on d.unitid=u.unitid'
      
        '     left join td_unitprice t on (d.productid=t.productid and t.' +
        'baseunit=1)   '
      
        '     left join td_unitprice l on (d.productid=l.productid and l.' +
        'u_no=0)       '
      
        '     left join tb_commission rm on d.relationbtype=1110 and d.re' +
        'lationbid=rm.bid'
      
        '     left join tb_commissiondtl r on d.relationbtype=1110 and d.' +
        'relationbid=r.bid and d.relationbno=r.bno'
      '    where d.bid=0')
    object qryDetail2bid: TIntegerField
      FieldName = 'bid'
    end
    object qryDetail2bno: TIntegerField
      FieldName = 'bno'
    end
    object qryDetail2borderno: TIntegerField
      FieldName = 'borderno'
    end
    object qryDetail2depotid: TIntegerField
      FieldName = 'depotid'
    end
    object qryDetail2productid: TIntegerField
      FieldName = 'productid'
    end
    object qryDetail2quantity: TFloatField
      FieldName = 'quantity'
    end
    object qryDetail2amount: TFloatField
      FieldName = 'amount'
    end
    object qryDetail2unitid: TIntegerField
      FieldName = 'unitid'
    end
    object qryDetail2bquantity: TFloatField
      FieldName = 'bquantity'
    end
    object qryDetail2bprice: TFloatField
      FieldName = 'bprice'
    end
    object qryDetail2unit1qty: TFloatField
      FieldName = 'unit1qty'
    end
    object qryDetail2unit2qty: TFloatField
      FieldName = 'unit2qty'
    end
    object qryDetail2unit3qty: TFloatField
      FieldName = 'unit3qty'
    end
    object qryDetail2assqty: TFloatField
      FieldName = 'assqty'
    end
    object qryDetail2relationassqty: TFloatField
      FieldName = 'relationassqty'
    end
    object qryDetail2expense: TFloatField
      FieldName = 'expense'
    end
    object qryDetail2material: TFloatField
      FieldName = 'material'
    end
    object qryDetail2batchcode: TStringField
      FieldName = 'batchcode'
      Size = 200
    end
    object qryDetail2productdate: TDateTimeField
      FieldName = 'productdate'
    end
    object qryDetail2validdate: TDateTimeField
      FieldName = 'validdate'
    end
    object qryDetail2relationqty: TFloatField
      FieldName = 'relationqty'
    end
    object qryDetail2relationcount: TByteField
      FieldName = 'relationcount'
    end
    object qryDetail2relationbtype: TIntegerField
      FieldName = 'relationbtype'
    end
    object qryDetail2relationbid: TIntegerField
      FieldName = 'relationbid'
    end
    object qryDetail2relationbno: TIntegerField
      FieldName = 'relationbno'
    end
    object qryDetail2relationcheckupbid: TIntegerField
      FieldName = 'relationcheckupbid'
    end
    object qryDetail2relationcheckupbno: TIntegerField
      FieldName = 'relationcheckupbno'
    end
    object qryDetail2ioqty: TFloatField
      FieldName = 'ioqty'
    end
    object qryDetail2explan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object qryDetail2price: TFloatField
      FieldName = 'price'
    end
    object qryDetail2machiningamt: TFloatField
      FieldName = 'machiningamt'
    end
    object qryDetail2custom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object qryDetail2custom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object qryDetail2custom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object qryDetail2custom4: TStringField
      FieldName = 'custom4'
      Size = 200
    end
    object qryDetail2custom5: TStringField
      FieldName = 'custom5'
      Size = 200
    end
    object qryDetail2custom6: TStringField
      FieldName = 'custom6'
      Size = 200
    end
    object qryDetail2custom7: TStringField
      FieldName = 'custom7'
      Size = 200
    end
    object qryDetail2custom8: TStringField
      FieldName = 'custom8'
      Size = 200
    end
    object qryDetail2custom9: TStringField
      FieldName = 'custom9'
      Size = 200
    end
    object qryDetail2custom10: TStringField
      FieldName = 'custom10'
      Size = 200
    end
    object qryDetail2custom11: TFloatField
      FieldName = 'custom11'
    end
    object qryDetail2custom12: TFloatField
      FieldName = 'custom12'
    end
    object qryDetail2custom13: TFloatField
      FieldName = 'custom13'
    end
    object qryDetail2custom14: TFloatField
      FieldName = 'custom14'
    end
    object qryDetail2custom15: TFloatField
      FieldName = 'custom15'
    end
    object qryDetail2saleorderbcode: TStringField
      FieldName = 'saleorderbcode'
      Size = 40
    end
    object qryDetail2relationbcode: TStringField
      FieldName = 'relationbcode'
      Size = 40
    end
    object qryDetail2length: TFloatField
      FieldName = 'length'
    end
    object qryDetail2width: TFloatField
      FieldName = 'width'
    end
    object qryDetail2height: TFloatField
      FieldName = 'height'
    end
    object qryDetail2specificweight: TFloatField
      FieldName = 'specificweight'
    end
    object qryDetail2custom16: TFloatField
      FieldName = 'custom16'
    end
    object qryDetail2custom17: TFloatField
      FieldName = 'custom17'
    end
    object qryDetail2custom18: TFloatField
      FieldName = 'custom18'
    end
    object qryDetail2custom19: TFloatField
      FieldName = 'custom19'
    end
    object qryDetail2custom20: TFloatField
      FieldName = 'custom20'
    end
    object qryDetail2qtitemid: TIntegerField
      FieldName = 'qtitemid'
    end
    object qryDetail2qtresultid: TIntegerField
      FieldName = 'qtresultid'
    end
    object qryDetail2qtdealresultid: TIntegerField
      FieldName = 'qtdealresultid'
    end
    object qryDetail2qtproblevid: TIntegerField
      FieldName = 'qtproblevid'
    end
    object qryDetail2qtworkerid: TIntegerField
      FieldName = 'qtworkerid'
    end
    object qryDetail2qtpickqty: TFloatField
      FieldName = 'qtpickqty'
    end
    object qryDetail2qtpickokqty: TFloatField
      FieldName = 'qtpickokqty'
    end
    object qryDetail2qtpickwasterqty: TFloatField
      FieldName = 'qtpickwasterqty'
    end
    object qryDetail2applyqty: TFloatField
      FieldName = 'applyqty'
    end
    object qryDetail2wasterqty: TFloatField
      FieldName = 'wasterqty'
    end
    object qryDetail2Allqty: TStringField
      FieldName = 'Allqty'
      Size = 30
    end
    object qryDetail2wasterrate: TFloatField
      FieldName = 'wasterrate'
    end
    object qryDetail2machiningbdate: TDateTimeField
      FieldName = 'machiningbdate'
    end
    object qryDetail2relationbcode_1: TStringField
      FieldName = 'relationbcode_1'
      Size = 40
    end
    object qryDetail2makeqty: TFloatField
      FieldName = 'makeqty'
    end
    object qryDetail2uncompletedqty: TFloatField
      FieldName = 'uncompletedqty'
    end
    object qryDetail2p_kind: TIntegerField
      FieldName = 'p_kind'
    end
    object qryDetail2p_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object qryDetail2p_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object qryDetail2p_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object qryDetail2p_abname: TWideStringField
      FieldName = 'p_abname'
      Size = 60
    end
    object qryDetail2p_custom1: TStringField
      FieldName = 'p_custom1'
      Size = 100
    end
    object qryDetail2p_custom2: TStringField
      FieldName = 'p_custom2'
      Size = 100
    end
    object qryDetail2p_custom3: TStringField
      FieldName = 'p_custom3'
      Size = 100
    end
    object qryDetail2p_custom4: TStringField
      FieldName = 'p_custom4'
      Size = 100
    end
    object qryDetail2p_custom5: TStringField
      FieldName = 'p_custom5'
      Size = 100
    end
    object qryDetail2p_custom6: TStringField
      FieldName = 'p_custom6'
      Size = 100
    end
    object qryDetail2p_custom7: TStringField
      FieldName = 'p_custom7'
      Size = 100
    end
    object qryDetail2p_custom8: TStringField
      FieldName = 'p_custom8'
      Size = 100
    end
    object qryDetail2p_custom9: TStringField
      FieldName = 'p_custom9'
      Size = 100
    end
    object qryDetail2p_custom10: TStringField
      FieldName = 'p_custom10'
      Size = 100
    end
    object qryDetail2producttypeid: TIntegerField
      FieldName = 'producttypeid'
    end
    object qryDetail2producttrademarkid: TIntegerField
      FieldName = 'producttrademarkid'
    end
    object qryDetail2depotcode: TStringField
      FieldName = 'depotcode'
      Size = 40
    end
    object qryDetail2depotname: TWideStringField
      FieldName = 'depotname'
      Size = 60
    end
    object qryDetail2barcode: TWideStringField
      FieldName = 'barcode'
      Size = 40
    end
    object qryDetail2unitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object qryDetail2unitrate: TFloatField
      FieldName = 'unitrate'
    end
    object qryDetail2baseunitname: TWideStringField
      FieldName = 'baseunitname'
      Size = 40
    end
    object qryDetail2unitassname: TWideStringField
      FieldName = 'unitassname'
      Size = 40
    end
    object qryDetail2productpic: TBlobField
      FieldName = 'productpic'
    end
    object qryDetail2relationwasterqty: TFloatField
      FieldName = 'relationwasterqty'
    end
    object qryDetail2uncompqty: TFloatField
      FieldName = 'uncompqty'
    end
  end
  object qryBatch: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select b.*, O.BatchCode,O.ProductDate,O.ValidDate,'
      
        '     cast((O.Quantity + isnull(b.Quantity,0)) as decimal(18,4)) ' +
        'as NetQty,f.price'
      '     from tb_comcheckacceptbatch b'
      
        '     inner join tb_comcheckacceptraw d on b.bid=d.bid and b.bno=' +
        'd.bno and b.bdtlno=d.bdtlno'
      
        '     inner join tb_commissionbatch O on d.Relationbid=O.bid and ' +
        'b.relationpid=O.relationpid'
      '     inner join tt_bill f on O.relationpid=f.tid'
      '     where b.bid=0'
      '     Order By O.relationpid')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 188
    Top = 373
    object qryBatchbid: TIntegerField
      FieldName = 'bid'
    end
    object qryBatchbno: TIntegerField
      FieldName = 'bno'
    end
    object qryBatchbdtlno: TIntegerField
      FieldName = 'bdtlno'
    end
    object qryBatchrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object qryBatchquantity: TFloatField
      FieldName = 'quantity'
    end
    object qryBatchBatchCode: TStringField
      FieldName = 'BatchCode'
      Size = 200
    end
    object qryBatchProductDate: TDateTimeField
      FieldName = 'ProductDate'
    end
    object qryBatchValidDate: TDateTimeField
      FieldName = 'ValidDate'
    end
    object qryBatchNetQty: TFloatField
      FieldName = 'NetQty'
    end
    object qryBatchprice: TFloatField
      FieldName = 'price'
    end
  end
  object dspBatch: TDataSetProvider
    DataSet = qryBatch
    UpdateMode = upWhereKeyOnly
    BeforeUpdateRecord = dspBatchBeforeUpdateRecord
    Left = 252
    Top = 373
  end
  object cdsBatch: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspBatch'
    OnNewRecord = cdsBatchNewRecord
    Left = 312
    Top = 373
    object cdsBatchbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsBatchbno: TIntegerField
      FieldName = 'bno'
    end
    object cdsBatchbdtlno: TIntegerField
      FieldName = 'bdtlno'
    end
    object cdsBatchrelationpid: TIntegerField
      FieldName = 'relationpid'
    end
    object cdsBatchquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsBatchBatchCode: TStringField
      FieldName = 'BatchCode'
      Size = 200
    end
    object cdsBatchProductDate: TDateTimeField
      FieldName = 'ProductDate'
    end
    object cdsBatchValidDate: TDateTimeField
      FieldName = 'ValidDate'
    end
    object cdsBatchNetQty: TFloatField
      FieldName = 'NetQty'
    end
    object cdsBatchprice: TFloatField
      FieldName = 'price'
    end
  end
end
